﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.IO;


namespace ConsoleApplication
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Login Name: ");
            string loginName = Console.ReadLine();
            Console.WriteLine("Password: ");
            string password = Console.ReadLine();
            string result = HttpGet("http://localhost:49586/Login.svc/login?loginName=qwe&password=111111");
            //string result = HttpGet("http://localhost:49586/Login.svc/login?loginName=" + loginName + "&password=" + password );
            //string result = HttpGet("http://google.com/");
            Console.WriteLine(result);
            
        }
        static string HttpGet(string url)
        {
            HttpWebRequest req = WebRequest.Create(url)
                                 as HttpWebRequest;
            string result = null;
            using (HttpWebResponse resp = req.GetResponse()
                                          as HttpWebResponse)
            {
                StreamReader reader =
                    new StreamReader(resp.GetResponseStream());
                result = reader.ReadToEnd();
            }
            return result;
        }
    }
}
